#!/usr/bin/python
# -*- coding: utf-8 -*-

# braegen front
#

import wx

class AdressenVerwaltung(wx.Panel):
    def __init__(self, parent):
        wx.Panel.__init__(self, parent)

        #panel = wx.Panel(self)

        hbox = wx.BoxSizer(wx.HORIZONTAL)

        fgs = wx.FlexGridSizer(5, 2, 5, 20)

        vorname = wx.StaticText(self, label="Vorname")
        nachname = wx.StaticText(self, label="Nachname")
        strasse = wx.StaticText(self, label="Strasse")
        plz = wx.StaticText(self, label="Postleitzahl")
        wohnort = wx.StaticText(self, label="Wohnort")

        tc_vorname = wx.TextCtrl(self)
        tc_nachname = wx.TextCtrl(self)        
        tc_strasse = wx.TextCtrl(self)
        tc_plz = wx.TextCtrl(self)
        tc_wohnort = wx.TextCtrl(self)

        fgs.AddMany([(vorname), (tc_vorname, 1, wx.EXPAND),
                     (nachname), (tc_nachname, 1, wx.EXPAND),
                     (strasse), (tc_strasse, 1, wx.EXPAND),
                     (plz), (tc_plz, 1, wx.EXPAND),
                     (wohnort), (tc_wohnort, 1, wx.EXPAND)])

        hbox.Add(fgs, proportion=1, flag=wx.ALL|wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=15)
        
        fgs.AddGrowableCol(1, 1)

        self.SetSizer(hbox)

        

class PageTwo(wx.Panel):
    def __init__(self, parent):
        wx.Panel.__init__(self, parent)
        t = wx.StaticText(self, -1, "This is a PageTwo object", (40,40))

class PageThree(wx.Panel):
    def __init__(self, parent):
        wx.Panel.__init__(self, parent)
        t = wx.StaticText(self, -1, "This is a PageThree object", (60,60))

class Example(wx.Frame):
  
    def __init__(self, parent, title):
        super(Example, self).__init__(parent, title=title, size=(500, 500))
            
        self.InitUI()
        self.Centre()
        self.Show()     
        
    def InitUI(self):
    
        panel = wx.Panel(self)

        font = wx.SystemSettings_GetFont(wx.SYS_SYSTEM_FONT)
        font.SetPointSize(9)

        vbox = wx.BoxSizer(wx.VERTICAL)

        hbox1 = wx.BoxSizer(wx.HORIZONTAL)
        st1 = wx.StaticText(panel, label='Suchen')
        st1.SetFont(font)
        hbox1.Add(st1, flag=wx.RIGHT, border=8)
        tc = wx.TextCtrl(panel)
        hbox1.Add(tc, proportion=1)
        vbox.Add(hbox1, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=10)

        vbox.Add((-1, 10))

        hbox2 = wx.BoxSizer(wx.HORIZONTAL)
        st2 = wx.StaticText(panel, label='Auswahl')
        st2.SetFont(font)
        hbox2.Add(st2)
        vbox.Add(hbox2, flag=wx.LEFT | wx.TOP, border=10)

        vbox.Add((-1, 10))
        

        hbox3 = wx.BoxSizer(wx.HORIZONTAL)
        
        nb = wx.Notebook(panel)
        
        # create the page windows as children of the notebook
        adv = AdressenVerwaltung(nb)
        page2 = PageTwo(nb)
        page3 = PageThree(nb)

        # add the pages to the notebook with the label to show on the tab
        nb.AddPage(adv, "Adressen")
        nb.AddPage(page2, "Page 2")
        nb.AddPage(page3, "Page 3")        
        hbox3.Add(nb, proportion=1, flag=wx.EXPAND)
        vbox.Add(hbox3, proportion=1, flag=wx.LEFT|wx.RIGHT|wx.EXPAND, border=10)

        vbox.Add((-1, 25))
        panel.SetSizer(vbox)


if __name__ == '__main__':
  
    app = wx.App()
    Example(None, title='Braegen')
    app.MainLoop()       
